<?
set_time_limit(0);
$socket=socket_create(AF_INET, SOCK_STREAM, 0) or die("err1");
$result = socket_bind($socket,"192.168.0.8",2055) or die("err2");
socket_set_option($socket,SOL_SOCKET,SO_REUSEADDR,1);
$result = socket_listen($socket,3) or die("err3");
$spawn = socket_accept($socket) or die("err4");
$stack = array();
$input=0;
$buffer="";
$in="";
while ($out = socket_read($spawn, 10)) {
    echo $out;
}
echo socket_strerror(socket_last_error($socket));
var_dump($buffer);
//$input = trim($input);
$mysongs = simplexml_load_string($input);
var_dump($mysongs);
echo $input;
socket_close($spawn);
socket_close($socket);
exit(0);
?>
